' Test oh ai (The last test done in SB, revised for SB1) test some string functions 2021-03-07 oh 
' SB test originally done 2018-09-15

' The main test here is testing if Split converts SB's array string to SB1's array string using Split.
' You don't have to Set to Get, Split sets up an Astring from a literal "data" string.
' That's the point of this exercise, but we show alternate ways to get a space in a variable and
' more talk about handling empty strings from ? Enters for Input statements.
' (That's all fixed fine in oh!)

' trim trims below by setting the string in border brackets!
months = trim[January February March April May June July August September October November December]
sp1 = spc[1]
' or sp1 = Chr(32)

lenOfSp1 = len[sp1]
. lenOfSp1; is the length of sp1 variable.

' make months an Astring for Get (works)
12Months = split[months,sp1]

'OK now try a Get
jan = get[12Months,1]
. (Hopefully) January should end this line for month 1 of 12 > ;jan
.
. I can name the month with just it's number:
[
	inpn 0 to quit, enter month number to name;nMonth
	if eq[nMonth, 0]
		. Goodbye!
		end
	el
		if and[gt[nMonth,0],lt[nMonth,13]]
			month = get[12months,nMonth]
			. The ;nMonth ;th month is ;month
		el
			. Sorry, the month range is 1 to 12. Try again.
		fi
		.
	fi
]